package cn.samler.diandi.api.mapper;

import cn.samler.diandi.api.entity.Post;
import cn.samler.diandi.api.model.io.request.post.Nearby;
import cn.samler.diandi.api.model.io.request.post.Search;
import cn.samler.diandi.api.model.io.request.post.SearchResult;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface PostMapper {
    Integer insert(Post post);
    List<Post> queryByPage(@Param("uid") int uid, @Param("start") int start, @Param("offset") int offset);
    List<SearchResult> nearby(Nearby form);
    SearchResult findById(int id);
    List<SearchResult> search(Search search);
    Integer display(@Param("uid") int uid, @Param("id") int id, @Param("show") boolean show);
    Integer delete(@Param("uid") int uid, @Param("id") int id);
    Integer update(Post post);
}
